package com.kanq.clockin.controller;

import com.kanq.clockin.entity.User;
import com.kanq.clockin.service.IClockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/login")
@CrossOrigin
public class ClockInController {

    @Autowired
    IClockService clockService;

    @GetMapping("/clock")
    public String clock(@RequestParam("user") String user){
        User userInfo = clockService.getUserInfo(user);
        String clock = clockService.actionClock(userInfo);
        return clock;
    }

}
